package com.visionblue.business.ship.receiver

import android.content.BroadcastReceiver
import android.content.Context
import android.content.Intent
import android.content.IntentFilter
import com.visionblue.business.ship.page.MainActivity

/**
 * @author: xlh
 * @date: 2020-06-24 2:27 PM
 * @desc:
 */
class BootReceiver : BroadcastReceiver() {
    override fun onReceive(context: Context?, intent: Intent?) {
        if (intent?.action == Intent.ACTION_BOOT_COMPLETED) {
            Intent(context, MainActivity::class.java)
                .setFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
                .run {
                    context?.startActivity(this)
                }
        }
    }
}